CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)

# Allows qtmain to be linked auto
IF(POLICY CMP0020)
  CMAKE_POLICY(SET CMP0020 NEW)
ENDIF()

# Include our generic module with all macros
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
INCLUDE(common)

# Define useful variables
SET(VERSION_MAJOR 1)
SET(VERSION_MINOR 2)
SET(VERSION_PATCH "REVISION")
SET(AUTHOR "MeltingPot")
SET(PRODUCT "CeB")
SET(DESCRIPTION "A Mtp Chat! Client written in C++/Qt4")
IF(PLUGIN)
	SET(TARGET "cebplugin")
ELSE(PLUGIN)
	SET(TARGET "ceb")
ENDIF(PLUGIN)
SET(TARGET_ICON "ceb/ceb.ico")
SET(YEAR "2006-2012")

INIT_PROJECT()

# Instruct CMake to run moc automatically when needed.
SET(CMAKE_AUTOMOC ON)

INIT_DEFAULT_OPTIONS()

OPTION(WITH_RYZOM "Use Ryzom configuration files" OFF)

# Qt doesn't use RTTI or C++ exceptions
SET_OPTION_DEFAULT(WITH_EXCEPTIONS OFF)
SET_OPTION_DEFAULT(WITH_RTTI OFF)
SET_OPTION_DEFAULT(WITH_INSTALL_LIBRARIES OFF)

SETUP_DEFAULT_OPTIONS()

INIT_BUILD_FLAGS()
SETUP_BUILD_FLAGS()

SETUP_PREFIX_PATHS(${TARGET})
SETUP_EXTERNAL()

GEN_CONFIG_H()

USE_QT_MODULES(Gui Network Xml Svg QT5 Widgets Multimedia)

INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/max/include)

ADD_SUBDIRECTORY(max)
ADD_SUBDIRECTORY(ceb)
